home *** CD-ROM | disk | FTP | other *** search
/ Virtual Casino: Secret Fantasies / Virtual Casino: Secret Fantasies.iso / setup.mst < prev   
Text File  |  1994-12-01  |  11KB  |  303 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1d Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40.  
  41. INIT:
  42.  
  43.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  44.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  45.  
  46.     WIN32ENABLED% = 0
  47.     MajorVer% = GetWindowsMajorVersion()
  48.     MinorVer% = GetWindowsMinorVersion()
  49.     Processor% = GetProcessorType()
  50.     WinDir$ = GetWindowsDir()
  51.     DEST$ = GetWindowsDir()
  52.     WinSysDir$ = GetWindowsSysDir()
  53.     WinSys32Dir$ = WinDir$ + "system32"
  54.  
  55.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  56.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  57.     END
  58.     END IF
  59.  
  60.     'Prevents installation on 286
  61.     IF Processor% < 3 THEN
  62.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  63.     END
  64.     END IF
  65.  
  66.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  67.     IF OnWindowsNT() THEN
  68.       OnNT$ = "TRUE"
  69.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  70.       IF WowVersion$ = "" THEN
  71.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  72.          END
  73.       END IF
  74.     END IF
  75.  
  76.     SetBitmap CUIDLL$, LOGO
  77.     SetTitle "Video for Windows 1.1d Runtime"
  78.  
  79.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  80.     IF szInf$ = "" THEN
  81.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  82.     END IF
  83.     ReadInfFile szInf$
  84.  
  85.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  86.  
  87. WELCOME:
  88.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  89.     IF sz$ = "CONTINUE" THEN
  90.        UIPop 1
  91.      ELSE
  92.     GOSUB ASKQUIT
  93.     GOTO WELCOME
  94.     END IF
  95.  
  96. ''Prepare Copy list and check size
  97.  
  98.     ClearCopyList
  99.     SrcDir$ = GetSymbolValue("STF_SRCDIR")+"vfw11d\"
  100.  
  101. ''  Runtime files (on Windows disk)
  102. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  103.  
  104.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN            'These files not necessary on Windows NT
  105.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  106.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  107.     END IF
  108.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  109.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  110.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  111.     IF OnNT$ = "TRUE" THEN
  112.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  113.     ENDIF
  114. ''*************************************************************************************************************************
  115. ''*************************************************************************************************************************
  116. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  117. ''and add a "DCI Provider" section with to the SETUP.INF file.
  118. ''
  119. ''    AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  120. ''*************************************************************************************************************************
  121. ''*************************************************************************************************************************
  122.  
  123. ''  Check windrive diskspace
  124.     SizeReq& = GetCopyListCost ("","", "")
  125.     IF SizeReq& <> 0 THEN
  126.     GOSUB SMALLWIN
  127.     END
  128.     END IF
  129.  
  130. Install
  131.  
  132. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  133. '' else, it gives the user the choice
  134.     RESTRT% = RestartListEmpty ()
  135.     Exe$ = DEST$ + "\_msrstrt.exe"
  136.     Batch$ = DEST$ + "\_mssetup.bat"
  137.     empty$ = ""
  138. RESTART:
  139.     IF RESTRT% = 0 THEN
  140.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  141.        IF sz$ = "REACTIVATE" THEN
  142.       GOTO RESTART
  143.        ENDIF
  144.        I% = ExitExecRestart ()
  145.        RemoveFile Exe$, cmoForce
  146.        RemoveFile Batch$, cmoForce
  147.        END
  148.     ELSE
  149.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  150.        IF sz$ = "CONTINUE" THEN
  151.       I% = ExitWindowsExec (Exe$, empty$)
  152.       IF I% = 0 THEN
  153.          GOTO RESTART
  154.       ELSE
  155.          END
  156.      ENDIF
  157.        ELSEIF sz$ = "EXIT" THEN
  158.       UIPopAll
  159.       END
  160.        ELSEIF sz$ = "REACTIVATE" THEN
  161.       GOTO RESTART
  162.        ELSE
  163.       UIPop 1
  164.        END IF
  165.     END IF
  166.  
  167.  
  168. QUIT:
  169.     ON ERROR GOTO ERRQUIT
  170.  
  171.     IF ERR = 0 THEN
  172.     dlg% = EXITSUCCESS
  173.     ELSEIF ERR = STFQUIT THEN
  174.     dlg% = EXITQUIT
  175.     ELSE
  176.     dlg% = EXITFAILURE
  177.     END IF
  178. QUITL1:
  179.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  180.     IF sz$ = "REACTIVATE" THEN
  181.     GOTO QUITL1
  182.     END IF
  183.     UIPop 1
  184.     END
  185.  
  186. ERRQUIT:
  187.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  188.     END
  189.  
  190.  
  191. ASKQUIT:
  192.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  193.  
  194.     IF sz$ = "EXIT" THEN
  195.     UIPopAll
  196. ''        ERROR STFQUIT
  197.     END
  198.     ELSEIF sz$ = "REACTIVATE" THEN
  199.     GOTO ASKQUIT
  200.     ELSE
  201.     UIPop 1
  202.     END IF
  203.     RETURN
  204.  
  205. SMALLWIN:
  206.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  207.     IF sz$ = "REACTIVATE" THEN
  208.     GOTO SMALLWIN
  209.     END IF
  210.     UIPop 1
  211.     RETURN
  212.  
  213. '**
  214. '** Purpose:
  215. '**     Performs all installation operations.
  216. '** Arguments:
  217. '**     none.
  218. '** Returns:
  219. '**     none.
  220. '*************************************************************************
  221. SUB Install STATIC
  222.  
  223.     SetRestartDir WinDir$
  224.     CopyFilesInCopyList
  225.  
  226. ''Updating WIN.INI and SYSTEM.INI
  227. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  228.  
  229. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  230.     IF VflatdPresent() = 0 THEN
  231.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  232.     END IF
  233. END IF
  234.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  235.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  236.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  237.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  238.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  239.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  240.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  241.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  242.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  243.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  244.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  246.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "ir21.dll", "Intel Indeo(TM) Video R2.1", cmoOverwrite
  247.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  248.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  249.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  250.  
  251. ''*************************************************************************************************************************
  252. ''*************************************************************************************************************************
  253. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the    <provider> with your own file name
  254. ''
  255. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  256. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  257. ''*************************************************************************************************************************
  258. ''*************************************************************************************************************************
  259.  
  260. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  261. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  262.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  263.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  264.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  265.  
  266. ''------------------------------------------
  267. ''--- EINTRAEGE FUER DAS CASINO - SETUP  ---
  268. ''------------------------------------------
  269.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  270.     CreateProgmanItem "Gentleman Club", "Virtual Casino", MakePath(SrcDir$, "casino.exe"), "", cmoOverwrite
  271.  
  272.  
  273. ''------------------------------------------
  274. ''--- ENDE DER EINTRAEGE                 ---
  275. ''------------------------------------------
  276.  
  277. END IF    ''NT and next version of Windows installation stop here.
  278.  
  279.     Run ("profdisp.exe")
  280. END SUB
  281.  
  282. '**
  283. '** Purpose:
  284. '**     Appends a file name to the end of a directory path,
  285. '**     inserting a backslash character as needed.
  286. '** Arguments:
  287. '**     szDir$  - full directory path (with optional ending "\")
  288. '**     szFile$ - filename to append to directory
  289. '** Returns:
  290. '**     Resulting fully qualified path name.
  291. '*************************************************************************
  292. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  293.     IF szDir$ = "" THEN
  294.     MakePath = szFile$
  295.     ELSEIF szFile$ = "" THEN
  296.     MakePath = szDir$
  297.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  298.     MakePath = szDir$ + szFile$
  299.     ELSE
  300.     MakePath = szDir$ + "\" + szFile$
  301.     END IF
  302. END FUNCTION
  303.